articles

home / developersection / articles / how do you hide a column for a databound gridview

How do you hide a column for a DataBound GridView

mohan kumar 8846 02-May-2012

The way to hide a column in a DataBound GridView is to trap the RowCreated Event and set a Cell inside the column of the row to Visible = false. Nice!


protected void myGrid_RowCreated(object senderGridViewRowEventArgs e)
{
{
//  hide a cell in the column to hide column 1   e.Row.Cells[1].Visible = false; } }

 


Updated 11-Jul-2020
mohan kumar

Other

Having around 5 Years experience in .NET domain.

Leave Comment

Comments

Liked By